package com.example.findmystuff;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class AdminPrivilegesActivity extends Activity {
	
	Button promote,demote,unlock,delete,home;
	/**
	 * This method is called when the activity is created
	 * @param savedInstanceState a bundle used to save the state that this instance of the activity is in.
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_admin_privileges);
		
		
		promote = (Button) findViewById(R.id.promoteButton);
		demote = (Button) findViewById(R.id.demoteButton);
		unlock = (Button) findViewById(R.id.unlockButton);
		delete = (Button) findViewById(R.id.deleteButton);
		home = (Button)findViewById(R.id.homeButton);
		
		promote.setOnClickListener ( 
				new View.OnClickListener() {
					
					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						Intent i = new Intent(AdminPrivilegesActivity.this, PromoteUserActivity.class);
						startActivity(i);
					}
				});
		
		demote.setOnClickListener ( 
				new View.OnClickListener() {
					
					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						Intent i = new Intent(AdminPrivilegesActivity.this, DemoteUserActivity.class);
						startActivity(i);
					}
				});
		
		unlock.setOnClickListener ( 
				new View.OnClickListener() {
					
					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						Intent i = new Intent(AdminPrivilegesActivity.this, UnlockAccountActivity.class);
						startActivity(i);
					}
				});
		
		delete.setOnClickListener ( 
				new View.OnClickListener() {
					
					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						Intent i = new Intent(AdminPrivilegesActivity.this, DeleteAccountActivity.class);
						startActivity(i);
					}
				});
		
		home.setOnClickListener ( 
				new View.OnClickListener() {
					
					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						MainActivity.loggedUser="";
						Intent i = new Intent(AdminPrivilegesActivity.this, AdminHomeActivity.class);
						startActivity(i);
					}
				});
	}
	/**
	 * Initializes the contents of the Activity's standard options menu.
	 * @param menu the standard options menu
	 */
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_admin_privileges, menu);
		return true;
	}

}
